/*
 * Copyright (c) 2011-2012  Cristian Constantin
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * @author Cristian Constantin
 * @since 1/16/12
 */


Ext.define('Quizio.view.QuizEditorPanel', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.quizeditor',

    initComponent: function() {

        this.items = [
            {
                baseCls: 'x-plain',

                items: {
                    xtype: 'textfield',
                    fieldLabel: 'Quiz name'
                }
            },
            {
                xtype: 'grid',
                store: Ext.create('Ext.data.ArrayStore', {
                    fields: ['name'],
                    data: [
                        ['Question 1', 'Single choice'],
                        ['Question 2', 'Single choice'],
                        ['Question 3', 'Single choice']
                    ]
                }),
                columns: [
                    { header: 'Question', dataIndex: 'name' },
                    { header: 'Type', dataIndex: 'type' }
                ],
                height: 200
            }
        ];


        this.buttons = [
            {
                action: 'save',
                text: 'Save quiz'
            }
        ];

        this.callParent(arguments);
    }
});
